import { PortalBaseSchema, PortalBaseSchemaType, PortalProperty, PortalPropertyType } from "../../interface/template/declare";
import { BasePortalDefination } from "./BasePortalDefination";


/**
 * banner 定义约束
 */
export class BannerPortalSchema implements PortalBaseSchema {
  type: PortalBaseSchemaType;
  name: string
  properties: PortalProperty[];

  constructor() {
    this.type = 'mutial'
    this.name = 'banner'
    this.properties = [
      {
        type: PortalPropertyType.File,
        title: '上传图片',
        name: 'thumbnail'
      },
      {
        type: PortalPropertyType.Link,
        title: '',
        name: 'link'
      }
    ]
  }
}

/**
 * banner 定义
 */
export class BannerPortalDefination extends BasePortalDefination {

  schema: BannerPortalSchema;
  
  link: string

  constructor() {
    super()
    this.schema = new BannerPortalSchema()
    this.title = '轮播图'
  }

}